package com.kitty.record.kittyjava.threadpool;

import java.util.concurrent.*;

/**
 * @Description
 * @Author SHEN
 * @Date 2021/1/8
 */
public class ThreadPoolDemo {


    public static void main(String[] args) {

        Executor executor = Executors.newSingleThreadExecutor();
        executor.execute(new MyTask("hahahah!!!!!!"));

        Executor executor1 = new ThreadPoolExecutor(10,30,60,
                TimeUnit.MILLISECONDS,new ArrayBlockingQueue<>(10));

    }
}

class MyTask implements Runnable {

    private String str1;

    public MyTask(String str) {
        str1 = str;
    }

    @Override
    public void run() {
        System.out.println(str1);
    }
}
